package gugga.eventHelpers
{
	import flash.events.IEventDispatcher;
	
	/**
	 * In broadcast implementations of event-driven environments such as 
	 * Flex and Flash, an event is fully described through its event source 
	 * (or the object from which this event originates), and the name which 
	 * distinguishes the event from the other events originating from the 
	 * same source.  
	 */
	public class EventDescriptor
	{
		private var mEventSource : IEventDispatcher;
		private var mEventName : String;
		
		public function get EventSource() : IEventDispatcher
		{
			return mEventSource;
		}
	
		public function get EventName() : String
		{
			return mEventName;
		}
		
		public function EventDescriptor(aEventSource : IEventDispatcher, aEventName : String)
		{
			mEventSource = aEventSource;
			mEventName = aEventName;
		}
		
		public function equals(aTarget : EventDescriptor) : Boolean
		{
			return ((mEventSource === aTarget.EventSource) && (mEventName == aTarget.EventName)); 
		}
	}
}